cmake_minimum_required(VERSION 3.1)

project(main)

include_directories(.)
include_directories(./my_example)
include_directories(./DashBoard/UI)

add_subdirectory(lvgl)
add_subdirectory(lv_drivers)
add_subdirectory(./DashBoard/UI)

set(TOOLCHAIN_DIR "/usr/local/arm/5.4.0/usr/")
set(CMAKE_C_COMPILER "${TOOLCHAIN_DIR}/bin/arm-linux-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_DIR}/bin/arm-linux-g++")

set(CMAKE_C_FLAGS "-Wl,-rpath=./lib/")

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)

file(GLOB_RECURSE MY_EXAMPLE_SOURCES "my_example/*.c")

add_executable(${PROJECT_NAME}
    main.c
    mouse_cursor_icon.c
    ${MY_EXAMPLE_SOURCES}
)

target_link_libraries(${PROJECT_NAME} PRIVATE lvgl)
target_link_libraries(${PROJECT_NAME} PRIVATE lvgl::examples)
target_link_libraries(${PROJECT_NAME} PRIVATE lvgl::demos)
target_link_libraries(${PROJECT_NAME} PRIVATE lvgl::drivers)
target_link_libraries(${PROJECT_NAME} PRIVATE ui)